<?php
/**
 * Created by PhpStorm.
 * User: hengliu
 * Date: 2019/7/8
 * Time: 3:06 PM
 */

// 第1组数据

$partial = "3366.1:7:3366.8:9:3366:6:3368:8";
$partial = '{"table":"futures/depth","action":"partial","data":[{"instrument_id":"BSV-USD-190816","asks":[["123.96","110","0","2"],["123.97","40","0","2"],["124.03","96","0","1"],["124.12","2","0","1"],["124.14","1645","0","2"],["124.19","250","0","1"],["124.21","10","0","1"],["124.22","10","0","1"],["124.25","10","0","1"],["124.31","66","0","1"],["124.39","360","0","1"],["124.4","233","0","1"],["124.45","360","0","1"],["124.5","757","0","1"],["124.59","865","0","1"],["124.75","960","0","2"],["124.8","2000","0","1"],["125.06","1522","0","1"],["125.09","1080","0","1"],["125.16","1230","0","1"],["125.3","121","0","1"],["125.33","30","0","1"],["125.44","144","0","1"],["125.7","5839","0","2"],["126.21","3528","0","1"],["127.15","2469","0","1"],["128.08","1189","0","1"],["131.0","515","0","1"],["138.3","64","0","1"],["138.31","128","0","2"],["138.33","128","0","2"],["141.37","128","0","2"],["142.37","64","0","1"],["142.9","64","0","1"],["144.43","106","0","1"],["144.46","20","0","1"],["144.86","185","0","1"],["145.29","187","0","1"],["145.72","239","0","1"],["146.15","101","0","1"],["146.58","228","0","1"],["147.01","299","0","1"],["147.45","297","0","1"],["147.89","283","0","1"],["148.33","223","0","1"],["148.77","278","0","1"],["149.21","129","0","1"],["149.65","269","0","1"],["150.09","128","0","1"],["150.16","20","0","1"],["150.54","124","0","1"],["150.99","134","0","1"],["151.44","213","0","1"],["151.89","195","0","1"],["152.34","116","0","1"],["152.79","224","0","1"],["153.24","290","0","1"],["153.69","202","0","1"],["154.15","243","0","1"],["154.61","286","0","1"],["155.07","126","0","1"],["155.53","185","0","1"],["155.99","167","0","1"],["156.45","204","0","1"],["156.46","64","0","1"],["156.91","191","0","1"],["157.38","244","0","1"],["157.85","249","0","1"],["158.32","234","0","1"],["158.79","236","0","1"],["159.26","163","0","1"],["159.73","273","0","1"],["160.0","1","0","1"],["160.2","106","0","1"],["160.21","264","0","1"],["160.69","187","0","1"],["161.17","125","0","1"],["161.66","253","0","1"],["165.0","1","0","1"],["169.0","1","0","1"]],"bids":[["123.66","44","0","1"],["123.62","6","0","1"],["123.53","364","0","1"],["123.49","2","0","1"],["123.44","24","0","1"],["123.43","120","0","1"],["123.42","24","0","1"],["123.39","231","0","1"],["123.37","96","0","1"],["123.35","96","0","1"],["123.23","16","0","1"],["123.21","240","0","1"],["123.19","2046","0","4"],["123.16","240","0","1"],["123.14","90","0","1"],["123.04","1230","0","2"],["122.97","360","0","1"],["122.96","196","0","1"],["122.9","360","0","1"],["122.89","2000","0","1"],["122.8","1385","0","1"],["122.6","480","0","1"],["122.59","480","0","1"],["122.58","5839","0","1"],["122.34","30","0","1"],["122.06","3529","0","1"],["121.76","2470","0","1"],["121.64","64","0","1"],["121.11","64","0","1"],["120.83","1190","0","1"],["120.55","159","0","1"],["118.36","142","0","1"],["114.0","10","0","1"],["104.76","202","0","1"],["104.45","213","0","1"],["104.14","160","0","1"],["103.82","138","0","1"],["103.5","282","0","1"],["103.18","159","0","1"],["102.87","106","0","1"],["102.56","189","0","1"],["102.25","161","0","1"],["101.94","197","0","1"],["101.63","117","0","1"],["101.32","145","0","1"],["101.01","288","0","1"],["100.7","149","0","1"],["100.39","193","0","1"],["100.08","271","0","1"],["99.77","273","0","1"],["99.47","233","0","1"],["99.17","147","0","1"],["98.87","122","0","1"],["98.57","149","0","1"],["98.27","205","0","1"],["97.97","102","0","1"],["97.67","269","0","1"],["97.37","237","0","1"],["97.07","235","0","1"],["96.77","194","0","1"],["96.47","265","0","1"],["96.18","102","0","1"],["95.89","105","0","1"],["95.6","166","0","1"],["95.31","195","0","1"],["95.02","295","0","1"],["94.73","135","0","1"],["94.44","291","0","1"],["94.15","276","0","1"],["93.86","237","0","1"],["93.57","104","0","1"],["93.28","258","0","1"],["93.0","235","0","1"]],"timestamp":"2019-08-15T06:45:25.158Z","checksum":447726740}]}';
$partial = '{"table":"futures\/depth_l2_tbt","action":"partial","data":[{"instrument_id":"BTC-USD-191101","asks":[["9430.97","2","0","1"],["9433.16","1","0","1"],["9433.97","48","0","1"],["9433.98","12","0","1"],["9434.5","4","0","4"],["9434.51","14","0","1"],["9435.61","33","0","1"],["9435.74","8","0","1"],["9436.12","2","0","1"],["9436.25","2","0","1"],["9436.37","2","0","1"],["9436.87","2","0","1"],["9437","96","0","1"],["9437.01","102","0","1"],["9437.29","47","0","1"],["9437.37","2","0","1"],["9437.49","2","0","1"],["9437.6","40","0","1"],["9437.67","90","0","1"],["9437.97","5","0","1"],["9438","90","0","1"],["9438.3","32","0","1"],["9438.53","3","0","1"],["9438.55","3","0","1"],["9439.07","22","0","1"],["9439.17","9","0","1"],["9439.25","9","0","1"],["9439.52","4","0","1"],["9439.58","94","0","1"],["9440","7","0","1"],["9440.13","10","0","1"],["9440.15","10","0","1"],["9440.32","18","0","1"],["9440.35","156","0","1"],["9440.46","60","0","1"],["9440.53","7","0","1"],["9440.54","7","0","1"],["9440.68","22","0","1"],["9440.79","24","0","1"],["9440.88","60","0","1"],["9440.9","169","0","1"],["9441.18","10","0","1"],["9441.23","30","0","1"],["9441.31","6","0","1"],["9441.55","350","0","1"],["9441.58","3","0","1"],["9441.6","3","0","1"],["9442.24","1","0","1"],["9442.3","15","0","1"],["9442.46","5","0","1"],["9442.7","6","0","1"],["9443.04","40","0","1"],["9443.26","1","0","1"],["9443.27","1","0","1"],["9443.31","10","0","1"],["9443.37","19","0","1"],["9443.52","7","0","1"],["9443.55","10","0","1"],["9444.01","51","0","1"],["9444.14","5","0","1"],["9444.3","20","0","1"],["9444.34","80","0","1"],["9444.4","3","0","1"],["9444.43","30","0","1"],["9444.65","3","0","1"],["9444.69","5","0","1"],["9444.77","161","0","1"],["9444.93","5","0","1"],["9445.18","1","0","1"],["9445.52","5","0","1"],["9445.55","3","0","1"],["9445.56","44","0","1"],["9445.57","24","0","1"],["9445.71","1","0","1"],["9446.45","211","0","1"],["9446.53","283","0","1"],["9446.66","50","0","1"],["9446.67","40","0","1"],["9446.94","10","0","1"],["9447.93","124","0","1"],["9448","43","0","1"],["9448.08","30","0","1"],["9448.54","195","0","1"],["9448.81","60","0","1"],["9449.07","28","0","1"],["9449.68","170","0","1"],["9450.54","274","0","1"],["9450.93","1","0","1"],["9451.5","1","0","1"],["9451.67","27","0","1"],["9452.06","30","0","1"],["9452.1","12","0","1"],["9452.7","55","0","1"],["9453","1","0","1"],["9453.88","173","0","1"],["9453.96","1","0","1"],["9454.26","120","0","1"],["9454.5","1","0","1"],["9454.87","40","0","1"],["9455.06","30","0","1"],["9455.58","499","0","1"],["9455.59","525","0","1"],["9456.46","37","0","1"],["9456.59","37","0","1"],["9456.65","160","0","1"],["9456.8","1","0","1"],["9457.5","29","0","1"],["9457.55","346","0","2"],["9458.06","30","0","1"],["9458.24","60","0","1"],["9458.25","190","0","1"],["9459.71","1","0","1"],["9461.06","661","0","1"],["9461.14","25","0","1"],["9461.94","200","0","1"],["9463.02","60","0","1"],["9463.92","55","0","1"],["9464.3","9","0","1"],["9464.61","112","0","2"],["9464.73","130","0","1"],["9465.59","160","0","1"],["9466.2","10","0","1"],["9467.02","1040","0","1"],["9467.39","50","0","1"],["9467.8","60","0","1"],["9467.81","140","0","1"],["9467.83","75","0","2"],["9467.91","1178","0","1"],["9468.1","9","0","1"],["9468.2","55","0","1"],["9470","144","0","1"],["9470.04","49","0","1"],["9470.42","53","0","1"],["9470.59","305","0","1"],["9470.62","37","0","1"],["9470.75","37","0","1"],["9470.87","178","0","1"],["9471.47","57","0","1"],["9472.37","50","0","1"],["9472.48","161","0","1"],["9472.52","80","0","1"],["9472.58","60","0","1"],["9472.6","58","0","1"],["9474.77","53","0","1"],["9474.79","51","0","1"],["9474.97","60","0","1"],["9475.43","450","0","1"],["9475.71","450","0","1"],["9475.8","41","0","1"],["9475.96","450","0","1"],["9476.15","27","0","1"],["9476.32","80","0","1"],["9476.44","52","0","1"],["9476.75","80","0","1"],["9477.57","58","0","1"],["9477.66","20","0","1"],["9477.9","300","0","1"],["9477.94","41","0","1"],["9478.58","1","0","1"],["9478.74","40","0","1"],["9478.81","145","0","1"],["9478.89","32","0","1"],["9478.98","60","0","1"],["9479.09","120","0","1"],["9479.11","60","0","1"],["9479.51","40","0","2"],["9479.67","60","0","1"],["9480","283","0","1"],["9480.2","146","0","1"],["9480.77","53","0","1"],["9482.46","843","0","1"],["9482.49","58","0","1"],["9482.69","40","0","1"],["9482.98","80","0","1"],["9483.11","80","0","1"],["9483.58","20","0","1"],["9485","94","0","1"],["9485.8","47","0","1"],["9485.92","152","0","1"],["9487.71","100","0","1"],["9487.8","48","0","1"],["9488.32","80","0","1"],["9490","144","0","1"],["9490.1","37","0","1"],["9491.62","152","0","1"],["9492","47","0","1"],["9492.23","100","0","1"],["9494.77","255","0","1"],["9495.04","37","0","1"],["9498.4","940","0","1"],["9498.41","9","0","1"],["9499","41","0","2"],["9499.93","4","0","1"],["9500","25","0","1"],["9500.63","27","0","1"],["9502.33","873","0","1"],["9502.75","18","0","1"],["9504.86","1000","0","1"],["9506.99","65","0","2"],["9510","8","0","1"],["9510.17","940","0","1"],["9512.02","58","0","1"],["9514.05","57","0","1"],["9516.28","554","0","1"],["9520","10","0","1"],["9527.4","600","0","1"],["9527.7","1040","0","1"],["9530","8","0","1"],["9532.28","53","0","1"],["9535","28","0","1"],["9535.24","230","0","3"],["9538","28","0","1"],["9542.65","810","0","1"],["9547.91","8","0","1"],["9549.37","142","0","1"],["9550","50","0","1"],["9555","10","0","1"],["9555.68","600","0","1"],["9560","9","0","1"],["9562","2","0","1"],["9565.61","799","0","1"],["9566","573","0","1"],["9567","1","0","1"],["9575","17","0","1"],["9575.25","360","0","1"],["9577.62","866","0","4"],["9582.8","1450","0","1"],["9588","47","0","1"],["9590.05","361","0","2"],["9591.75","95","0","1"],["9598.72","9","0","1"],["9600","964","0","7"],["9605.87","189","0","2"],["9612.77","182","0","1"],["9620","70","0","1"],["9622.13","4","0","1"],["9623","9","0","1"],["9634.13","95","0","1"],["9636","1","0","1"],["9640","94","0","1"],["9648.91","140","0","1"],["9650","43","0","1"],["9652.92","1","0","1"],["9660","2","0","1"],["9661.14","100","0","1"],["9670","1160","0","1"],["9688","20","0","1"],["9700","3","0","1"],["9710.7","5","0","1"],["9731.32","3","0","1"],["9745.58","4","0","1"],["9747.14","22","0","2"],["9755.4","200","0","1"],["9785","1","0","1"],["9800","108","0","4"],["9807.71","1","0","1"],["9825","12","0","1"],["9830","20","0","1"],["9842.64","57","0","1"],["9849.65","500","0","1"],["9850","106","0","3"],["9886.73","2","0","1"],["9888","20","0","1"],["9888.26","1","0","1"],["9888.4","1","0","1"],["9916.65","250","0","1"],["9936.94","1","0","1"],["9959.03","1","0","1"],["9966","1","0","1"],["9980","10","0","1"],["10000","169","0","3"],["10013.84","1","0","1"],["10029.66","40","0","1"],["10076","18","0","1"],["10123.74","2","0","1"],["10137","9","0","1"],["10160","2","0","1"],["10170.93","1","0","1"],["10188","57","0","1"],["10200","86","0","1"],["10217.77","2","0","1"],["10237.77","2","0","1"],["10257.77","2","0","1"],["10260","7","0","1"],["10277.77","2","0","1"],["10296.37","2","0","1"],["10297.77","2","0","1"],["10317.77","2","0","1"],["10337.77","2","0","1"],["10367.77","1","0","1"],["10386.46","61","0","1"],["10387.77","1","0","1"],["10400","944","0","1"],["10407.77","1","0","1"],["10409.8","1","0","1"],["10427.77","1","0","1"],["10447.77","1","0","1"],["10459.62","3","0","1"],["10467.77","1","0","1"],["10487.77","1","0","1"],["10497.77","1","0","1"],["10500","6","0","2"],["10507.77","1","0","1"],["10517.77","1","0","1"],["10527.77","1","0","1"],["10537.77","1","0","1"],["10547.77","1","0","1"],["10557.77","1","0","1"],["10567.77","1","0","1"],["10577.77","1","0","1"],["10587.77","1","0","1"],["10597.77","1","0","1"],["10607.77","1","0","1"],["10617.77","1","0","1"],["10625","18","0","1"],["10627.77","1","0","1"],["10637.77","1","0","1"],["10647.77","1","0","1"],["10657.77","1","0","1"],["10667.77","1","0","1"],["10677.77","1","0","1"],["10687.77","1","0","1"],["10688","2","0","1"],["10697.77","1","0","1"],["10698","7","0","1"],["10707.77","1","0","1"],["10717.77","1","0","1"],["10727.77","1","0","1"],["10737.77","1","0","1"],["10747.77","1","0","1"],["10757.77","1","0","1"],["10767.77","1","0","1"],["10777.77","1","0","1"],["10787.77","1","0","1"],["10797.77","1","0","1"],["10817.77","1","0","1"],["10823.62","820","0","1"],["10837.77","1","0","1"],["10856.09","679","0","1"],["10857.77","1","0","1"],["10877.77","1","0","1"],["10888.65","1476","0","1"],["10897.77","1","0","1"],["10917.77","1","0","1"],["10921.31","881","0","1"],["10937.77","1","0","1"],["10950","988","0","1"],["10954.07","881","0","1"],["10957.77","1","0","1"],["10977.77","1","0","1"],["10986.93","1132","0","1"],["10997.77","1","0","1"],["11019.89","906","0","1"],["11052.94","1122","0","1"],["11086.09","533","0","1"],["11118","10","0","1"],["11119.34","1479","0","1"],["11152.69","1071","0","1"],["11186.14","1484","0","1"],["11219.7","794","0","1"],["11253.34","882","0","1"],["11287.1","1477","0","1"],["11320.96","808","0","1"],["11354.93","1100","0","1"],["11389","1177","0","1"],["11423.14","843","0","1"],["11423.15","639","0","1"],["11444","17","0","1"],["11457.4","526","0","1"],["11457.41","710","0","1"],["11491.78","985","0","1"],["11526.25","1378","0","1"],["11560.83","1396","0","1"],["11595.49","1084","0","1"],["11595.5","936","0","1"],["11630.28","756","0","1"],["11665.17","519","0","1"],["11700.16","1197","0","1"],["11735.27","1168","0","1"],["11770.45","1040","0","1"],["11770.48","904","0","1"],["11805.77","833","0","1"],["11805.8","852","0","1"],["11841.17","1248","0","1"],["11876.7","1400","0","1"],["11912.32","519","0","1"],["11948.06","743","0","1"],["11960","80","0","1"],["11983.89","1490","0","1"],["12019.85","578","0","1"],["12019.86","748","0","1"],["12055.91","1313","0","1"],["12092.08","744","0","1"],["12128.35","1236","0","1"],["12164.74","1171","0","1"],["12201.24","802","0","1"],["12237.85","1401","0","1"],["12274.57","1360","0","1"],["12311.4","640","0","1"],["12348.34","1154","0","1"],["12385.39","871","0","1"],["12422.55","907","0","1"],["12459.82","1112","0","1"],["12497.2","1217","0","1"],["12534.7","1390","0","1"],["12572.31","1468","0","1"],["12610.03","1257","0","1"],["12647.87","581","0","1"],["12685.82","790","0","1"],["12723.88","1375","0","1"],["12762.06","1404","0","1"],["12800.35","770","0","1"],["12838.76","887","0","1"],["12877.28","859","0","1"],["12915.92","718","0","1"],["12954.67","563","0","1"],["12993.54","989","0","1"],["13032.53","776","0","1"],["13071.63","538","0","1"],["13110.85","607","0","1"],["13150.19","1157","0","1"],["13189.65","1368","0","1"],["13229.22","509","0","1"],["13268.91","1322","0","1"],["13308.72","939","0","1"],["13348.65","890","0","1"],["13388.7","949","0","1"],["13428.87","1261","0","1"],["13469.16","1003","0","1"],["13509.57","1383","0","1"],["13550.1","1244","0","1"],["13590.76","675","0","1"],["13631.54","1283","0","1"],["13672.44","1383","0","1"],["13713.46","617","0","1"],["13754.61","950","0","1"],["13795.88","1255","0","1"],["13837.27","1498","0","1"],["13878.79","1472","0","1"],["13920.43","1155","0","1"],["13962.2","845","0","1"],["14004.09","1402","0","1"],["14046.11","635","0","1"],["14088.25","1223","0","1"],["14130.52","1043","0","1"],["14172.92","1307","0","1"],["14215.44","1128","0","1"],["14258.09","816","0","1"],["14300.87","943","0","1"],["18176","100","0","1"],["25400","15","0","1"],["27690","100","0","1"]],"bids":[["9430.39","615","0","1"],["9430.09","24","0","1"],["9429.51","1","0","1"],["9429.42","8","0","1"],["9429.15","5","0","1"],["9429.1","30","0","1"],["9429.04","50","0","1"],["9428.99","40","0","1"],["9428.6","2","0","1"],["9428.52","14","0","1"],["9428.15","1","0","1"],["9428.03","20","0","1"],["9428.01","78","0","1"],["9427.93","130","0","1"],["9427.92","50","0","1"],["9427.38","47","0","1"],["9427.25","200","0","1"],["9426.1","30","0","1"],["9426.08","201","0","1"],["9426.03","9","0","1"],["9425.95","32","0","1"],["9425.62","9","0","1"],["9425.28","94","0","1"],["9425.01","170","0","1"],["9424.98","29","0","1"],["9424.87","40","0","1"],["9424.64","93","0","1"],["9424.26","56","0","1"],["9424.21","2","0","1"],["9424.18","40","0","1"],["9424.02","22","0","1"],["9423.67","2","0","1"],["9423.65","2","0","1"],["9423.63","15","0","1"],["9423.32","24","0","1"],["9423.11","19","0","1"],["9423.1","30","0","1"],["9422.98","2","0","1"],["9422.9","2","0","1"],["9422.67","60","0","1"],["9422.52","20","0","1"],["9422.41","160","0","1"],["9422.21","3","0","1"],["9422.19","3","0","1"],["9422.09","350","0","1"],["9421.61","28","0","1"],["9421.36","3","0","1"],["9421.34","3","0","1"],["9421.32","3","0","1"],["9421.29","10","0","1"],["9421.26","3","0","1"],["9421.24","3","0","1"],["9421.02","2","0","1"],["9421","2","0","1"],["9420.81","3","0","1"],["9420.79","16","0","2"],["9420.51","241","0","1"],["9420.15","54","0","1"],["9420.1","30","0","1"],["9420.09","1","0","1"],["9420.08","50","0","1"],["9420","1","0","1"],["9419.9","60","0","1"],["9419.6","80","0","1"],["9419.11","7","0","1"],["9419.09","150","0","1"],["9418.68","56","0","1"],["9418.5","1","0","1"],["9418.49","24","0","1"],["9418.44","37","0","1"],["9417.7","12","0","1"],["9417.23","1","0","1"],["9417.1","30","0","1"],["9417","1","0","1"],["9416.84","200","0","1"],["9416.58","40","0","1"],["9416.5","10","0","1"],["9415.57","2","0","1"],["9414.36","12","0","1"],["9414.1","30","0","1"],["9413.77","284","0","1"],["9413.62","1","0","1"],["9413.59","160","0","1"],["9413.55","10","0","1"],["9413.16","499","0","1"],["9413.08","5","0","1"],["9412.5","27","0","1"],["9411.36","143","0","1"],["9410.48","120","0","1"],["9410.44","60","0","1"],["9408.95","525","0","1"],["9408.66","13","0","1"],["9408.15","160","0","1"],["9406.7","28","0","1"],["9406.4","28","0","1"],["9406","25","0","1"],["9405.74","200","0","1"],["9405.15","224","0","1"],["9404.33","9","0","1"],["9403.86","663","0","1"],["9403.6","26","0","1"],["9403.14","190","0","1"],["9402.54","55","0","1"],["9402.45","940","0","1"],["9401.89","146","0","2"],["9401.31","37","0","1"],["9401.08","204","0","1"],["9400.22","1","0","1"],["9400","249","0","3"],["9399.01","1","0","1"],["9398.61","49","0","1"],["9398.27","160","0","1"],["9397.89","40","0","1"],["9397.29","169","0","1"],["9396.59","50","0","1"],["9394.69","18","0","1"],["9394.35","41","0","1"],["9394.24","40","0","2"],["9394.13","93","0","1"],["9394.11","80","0","1"],["9393.98","101","0","2"],["9393.88","1146","0","1"],["9392.57","28","0","1"],["9392.39","302","0","1"],["9391.55","52","0","1"],["9390.39","60","0","1"],["9390.37","120","0","1"],["9390.19","80","0","1"],["9390","4","0","1"],["9388.93","40","0","1"],["9388.86","47","0","1"],["9388.85","27","0","1"],["9388.6","450","0","1"],["9387.81","900","0","1"],["9387.15","37","0","1"],["9385.88","9","0","1"],["9385.68","37","0","1"],["9385.15","60","0","1"],["9383.21","450","0","1"],["9380.92","80","0","1"],["9380","121","0","2"],["9379.86","34","0","1"],["9379.84","450","0","1"],["9378.93","146","0","1"],["9375","5","0","1"],["9373.65","1084","0","1"],["9373.22","152","0","1"],["9371.88","37","0","1"],["9371.51","9","0","1"],["9370","10","0","1"],["9367.49","152","0","1"],["9365.76","37","0","1"],["9365.2","27","0","1"],["9361.62","874","0","1"],["9358.45","10","0","1"],["9358","3","0","1"],["9357.94","1020","0","1"],["9357.04","37","0","1"],["9355","131","0","2"],["9354.74","450","0","1"],["9354.71","1000","0","1"],["9352.07","600","0","1"],["9350","282","0","1"],["9349.39","450","0","1"],["9348","18","0","1"],["9346.79","900","0","1"],["9346.1","9","0","1"],["9346.03","450","0","1"],["9339.03","93","0","1"],["9335","896","0","1"],["9334.39","361","0","1"],["9329.47","847","0","1"],["9328","68","0","1"],["9327.72","555","0","1"],["9323.79","600","0","1"],["9317.57","799","0","1"],["9317","6","0","1"],["9313.22","53","0","1"],["9312.01","1","0","1"],["9312","1","0","1"],["9308.27","8","0","1"],["9305","9","0","1"],["9300","146","0","7"],["9288","47","0","1"],["9285","27","0","1"],["9280","484","0","2"],["9276.17","185","0","1"],["9275","74","0","1"],["9271.72","6","0","1"],["9269","47","0","1"],["9267","1","0","1"],["9266.85","55","0","1"],["9266","34","0","1"],["9265","1","0","1"],["9261.32","183","0","1"],["9260.66","68","0","1"],["9260","1111","0","1"],["9259.78","277","0","1"],["9258","4","0","1"],["9255.56","5","0","1"],["9250","70","0","2"],["9236.24","140","0","1"],["9220","737","0","4"],["9206.84","100","0","1"],["9204.83","9","0","1"],["9201","130","0","3"],["9200","326","0","6"],["9191","41","0","1"],["9190","183","0","1"],["9185.17","83","0","1"],["9184.5","100","0","1"],["9174","550","0","1"],["9167.96","18","0","1"],["9161.01","1","0","1"],["9160","13","0","1"],["9158","5","0","1"],["9156","9","0","1"],["9150","102","0","7"],["9141.59","100","0","1"],["9140","182","0","1"],["9123","9","0","1"],["9120","2","0","1"],["9118","42","0","1"],["9110","9","0","1"],["9102.21","54","0","1"],["9101","125","0","3"],["9100","71","0","4"],["9090.29","200","0","1"],["9083.21","15","0","1"],["9072.12","45","0","1"],["9050","75","0","4"],["9045","1","0","1"],["9043","180","0","1"],["9039","3","0","1"],["9037.07","82","0","1"],["9035.37","100","0","1"],["9025.01","180","0","1"],["9023","9","0","1"],["9015","4","0","1"],["9010","9","0","1"],["9008","108","0","1"],["9007.07","9","0","1"],["9001.03","100","0","1"],["9001.01","1","0","1"],["9001","125","0","3"],["9000","55","0","4"],["8996.1","300","0","1"],["8992.1","35","0","1"],["8966","125","0","1"],["8965.48","17","0","1"],["8950","2","0","1"],["8941.2","35","0","1"],["8926.4","4","0","1"],["8923","8","0","1"],["8910","105","0","1"],["8908","3","0","1"],["8903.57","100","0","1"],["8900","19","0","2"],["8899.56","35","0","1"],["8888","3","0","1"],["8887.47","4","0","1"],["8872.1","35","0","1"],["8851","8","0","1"],["8850","12","0","1"],["8836.7","176","0","1"],["8833","176","0","1"],["8830","5","0","1"],["8820","5","0","1"],["8810.15","11","0","1"],["8800","28","0","2"],["8788","13","0","1"],["8774.47","4","0","1"],["8772.43","20","0","1"],["8715","5","0","1"],["8711","20","0","1"],["8701.59","100","0","1"],["8700","9","0","2"],["8685.19","17","0","1"],["8666","125","0","1"],["8655","180","0","1"],["8633","172","0","1"],["8600","6","0","1"],["8580","300","0","1"],["8570","20","0","1"],["8560","256","0","1"],["8525","66","0","1"],["8509","144","0","1"],["8501.01","1","0","1"],["8500","1","0","1"],["8495","10","0","1"],["8489.42","1","0","1"],["8444","12","0","1"],["8379.07","41","0","1"],["8350","835","0","1"],["8333","250","0","1"],["8321.58","1","0","1"],["8318.69","166","0","1"],["8282.22","2","0","1"],["8262.22","2","0","1"],["8242.22","2","0","1"],["8222.22","2","0","1"],["8202.22","2","0","1"],["8182.22","2","0","1"],["8162.22","2","0","1"],["8154","4","0","1"],["8142.22","2","0","1"],["8122.22","2","0","1"],["8102.22","2","0","1"],["8100","10","0","1"],["8096.48","1","0","1"],["8082.22","2","0","1"],["8062.22","2","0","1"],["8042.22","2","0","1"],["8022.22","2","0","1"],["8008","80","0","1"],["8004","4","0","1"],["8002.22","2","0","1"],["8000","30","0","1"],["7979.16","812","0","1"],["7955.23","1317","0","1"],["7931.37","971","0","1"],["7907.58","1352","0","1"],["7883.86","1380","0","1"],["7860.21","1353","0","1"],["7836.63","1023","0","1"],["7813.12","692","0","1"],["7789.7","809","0","1"],["7766.33","1323","0","1"],["7743.05","995","0","1"],["7743.04","559","0","1"],["7719.83","766","0","1"],["7696.68","1425","0","1"],["7673.59","1435","0","1"],["7650.57","647","0","1"],["7627.62","1068","0","1"],["7604.74","1378","0","1"],["7600","12","0","1"],["7581.92","909","0","1"],["7559.2","595","0","1"],["7543","75","0","1"],["7536.53","922","0","1"],["7513.92","999","0","1"],["7491.39","1278","0","1"],["7468.91","1326","0","1"],["7446.51","941","0","1"],["7440","840","0","1"],["7424.18","1107","0","1"],["7401.92","726","0","1"],["7379.72","1465","0","1"],["7370","1","0","1"],["7357.59","1031","0","1"],["7335.52","1358","0","1"],["7313.52","756","0","1"],["7300.5","7","0","1"],["7300","1","0","1"],["7291.58","759","0","1"],["7269.71","832","0","1"],["7247.9","603","0","1"],["7240","1","0","1"],["7226.17","689","0","1"],["7204.5","1474","0","1"],["7200","7","0","1"],["7182.88","773","0","1"],["7161.35","546","0","1"],["7139.87","1098","0","1"],["7118.46","793","0","1"],["7118.45","1045","0","1"],["7097.1","1058","0","1"],["7075.8","1064","0","1"],["7054.59","656","0","1"],["7033.42","1180","0","1"],["7012.33","1470","0","1"],["6991.3","608","0","1"],["6970.33","607","0","1"],["6949.41","1073","0","1"],["6928.57","765","0","1"],["6907.78","807","0","1"],["6887.07","1465","0","1"],["6866.4","991","0","1"],["6845.82","1164","0","1"],["6825.29","637","0","1"],["6804.83","625","0","1"],["6804.81","687","0","1"],["6784.41","1025","0","1"],["6764.05","1033","0","1"],["6743.77","632","0","1"],["6723.53","1370","0","1"],["6703.37","857","0","1"],["6700","1","0","1"],["6683.26","815","0","1"],["6663.21","711","0","1"],["6643.22","998","0","1"],["6623.29","915","0","1"],["6603.42","967","0","1"],["6583.63","1206","0","1"],["6563.87","806","0","1"],["6544.17","900","0","1"],["6524.53","1093","0","1"],["6504.95","872","0","1"],["6485.43","1073","0","1"],["6465.97","1399","0","1"],["6446.57","626","0","1"],["6433.33","2","0","1"],["6427.23","1148","0","1"],["6407.94","788","0","1"],["6388.71","1050","0","1"],["6369.54","981","0","1"],["6350.43","599","0","1"],["6333.33","2","0","1"],["6331.37","677","0","1"],["6312.37","581","0","1"],["6293.43","520","0","1"],["6274.54","885","0","1"],["6255.71","1202","0","1"],["6236.94","562","0","1"],["6233.33","2","0","1"],["6218.22","647","0","1"],["6199.56","1461","0","1"],["6180.96","720","0","1"],["6162.41","1348","0","1"],["6143.92","1011","0","1"],["6133.33","3","0","1"],["6125.48","612","0","1"],["6107.1","1481","0","1"],["6088.77","1380","0","1"],["6070.5","1036","0","1"],["6063.33","3","0","1"],["6052.28","603","0","1"],["6034.12","1021","0","1"],["6016.01","1361","0","1"],["6014.33","3","0","1"],["5997.96","738","0","1"],["5979.96","870","0","1"],["5933.33","3","0","1"],["5833.33","3","0","1"],["5733.33","3","0","1"],["5633.33","3","0","1"],["4555.33","2","0","1"],["4502.22","3","0","1"],["4452.22","2","0","1"],["4402.22","2","0","1"],["4352.22","2","0","1"],["4302.22","2","0","1"],["4252.22","2","0","1"],["4202.22","2","0","1"],["4152.22","2","0","1"],["4102.22","2","0","1"],["2222","4","0","2"]],"timestamp":"2019-10-29T13:13:15.868Z","checksum":1483110591}]}';
$update = '{"table":"futures/depth_l2_tbt","action":"update","data":[{"instrument_id":"BTC-USD-191101","asks":[["9434.51","0","0","0"],["9435.79","14","0","1"],["9436.37","0","0","0"],["9437.49","0","0","0"],["9438","0","0","0"],["9442.24","0","0","0"],["9446.66","0","0","0"],["9448","0","0","0"],["9452.1","0","0","0"],["9466.79","0","0","0"],["9475.71","0","0","0"],["9475.96","0","0","0"],["9480.94","37","0","1"]],"bids":[["9429.92","14","0","1"],["9429.51","0","0","0"],["9429.34","0","0","0"],["9429.04","50","0","1"],["9428.7","0","0","0"],["9428.52","0","0","0"],["9427.92","0","0","0"],["9427.38","0","0","0"],["9427.23","32","0","1"],["9425.95","0","0","0"],["9425.28","0","0","0"],["9425.07","30","0","1"],["9425.01","0","0","0"],["9424.18","0","0","0"],["9424.02","0","0","0"],["9420.08","0","0","0"],["9414.36","0","0","0"],["9413.77","0","0","0"],["9403.86","0","0","0"],["9400.22","0","0","0"],["9399.14","0","0","0"],["9384.99","0","0","0"],["9379.84","0","0","0"],["9346.03","0","0","0"]],"timestamp":"2019-10-29T13:14:32.472Z","checksum":1651921077}]}';
//$partial = '{"table":"futures/depth","action":"partial","data":[{"instrument_id":"BSV-USD-190816","asks":[["123.97","40","0","2"],["124.03","96","0","1"],["124.06","96","0","1"],["124.12","2","0","1"],["124.13","3","0","1"],["124.14","1645","0","2"],["124.19","250","0","1"],["124.21","10","0","1"],["124.22","10","0","1"],["124.23","240","0","1"],["124.25","10","0","1"],["124.31","66","0","1"],["124.4","233","0","1"],["124.45","360","0","1"],["124.5","757","0","1"],["124.59","865","0","1"],["124.75","960","0","2"],["124.8","2000","0","1"],["125.06","1522","0","1"],["125.09","1080","0","1"],["125.16","1230","0","1"],["125.3","121","0","1"],["125.33","30","0","1"],["125.44","144","0","1"],["125.7","5839","0","2"],["126.21","3528","0","1"],["127.15","2469","0","1"],["128.08","1189","0","1"],["131.0","515","0","1"],["138.3","64","0","1"],["138.31","128","0","2"],["138.33","128","0","2"],["141.37","128","0","2"],["142.37","64","0","1"],["142.9","64","0","1"],["144.43","106","0","1"],["144.46","20","0","1"],["144.86","185","0","1"],["145.29","187","0","1"],["145.72","239","0","1"],["146.15","101","0","1"],["146.58","228","0","1"],["147.01","299","0","1"],["147.45","297","0","1"],["147.89","283","0","1"],["148.33","223","0","1"],["148.77","278","0","1"],["149.21","129","0","1"],["149.65","269","0","1"],["150.09","128","0","1"],["150.16","20","0","1"],["150.54","124","0","1"],["150.99","134","0","1"],["151.44","213","0","1"],["151.89","195","0","1"],["152.34","116","0","1"],["152.79","224","0","1"],["153.24","290","0","1"],["153.69","202","0","1"],["154.15","243","0","1"],["154.61","286","0","1"],["155.07","126","0","1"],["155.53","185","0","1"],["155.99","167","0","1"],["156.45","204","0","1"],["156.46","64","0","1"],["156.91","191","0","1"],["157.38","244","0","1"],["157.85","249","0","1"],["158.32","234","0","1"],["158.79","236","0","1"],["159.26","163","0","1"],["159.73","273","0","1"],["160.0","1","0","1"],["160.2","106","0","1"],["160.21","264","0","1"],["160.69","187","0","1"],["161.17","125","0","1"],["161.66","253","0","1"],["165.0","1","0","1"],["169.0","1","0","1"]],"bids":[["123.66","44","0","1"],["123.62","6","0","1"],["123.53","364","0","1"],["123.49","2","0","1"],["123.44","24","0","1"],["123.43","120","0","1"],["123.42","24","0","1"],["123.39","231","0","1"],["123.37","96","0","1"],["123.35","96","0","1"],["123.23","16","0","1"],["123.21","240","0","1"],["123.19","2046","0","4"],["123.14","90","0","1"],["123.04","1230","0","2"],["122.97","360","0","1"],["122.96","196","0","1"],["122.9","360","0","1"],["122.89","2000","0","1"],["122.8","1385","0","1"],["122.6","480","0","1"],["122.59","480","0","1"],["122.58","5839","0","1"],["122.34","30","0","1"],["122.06","3529","0","1"],["121.76","2470","0","1"],["121.64","64","0","1"],["121.11","64","0","1"],["120.83","1190","0","1"],["120.55","159","0","1"],["118.36","142","0","1"],["114.0","10","0","1"],["104.76","202","0","1"],["104.45","213","0","1"],["104.14","160","0","1"],["103.82","138","0","1"],["103.5","282","0","1"],["103.18","159","0","1"],["102.87","106","0","1"],["102.56","189","0","1"],["102.25","161","0","1"],["101.94","197","0","1"],["101.63","117","0","1"],["101.32","145","0","1"],["101.01","288","0","1"],["100.7","149","0","1"],["100.39","193","0","1"],["100.08","271","0","1"],["99.77","273","0","1"],["99.47","233","0","1"],["99.17","147","0","1"],["98.87","122","0","1"],["98.57","149","0","1"],["98.27","205","0","1"],["97.97","102","0","1"],["97.67","269","0","1"],["97.37","237","0","1"],["97.07","235","0","1"],["96.77","194","0","1"],["96.47","265","0","1"],["96.18","102","0","1"],["95.89","105","0","1"],["95.6","166","0","1"],["95.31","195","0","1"],["95.02","295","0","1"],["94.73","135","0","1"],["94.44","291","0","1"],["94.15","276","0","1"],["93.86","237","0","1"],["93.57","104","0","1"],["93.28","258","0","1"],["93.0","235","0","1"]],"timestamp":"2019-08-15T06:45:25.258Z","checksum":174965541}]}';

// 第2组数据
//$partial = '{"table":"futures/depth","action":"partial","data":[{"instrument_id":"EOS-USD-190927","asks":[["4.236","116","0","14"],["4.237","530","0","5"],["4.238","4968","0","7"],["4.239","797","0","3"],["4.24","578","0","10"],["4.241","704","0","8"],["4.242","9209","0","11"],["4.243","1655","0","7"],["4.244","663","0","7"],["4.245","667","0","5"],["4.246","1547","0","14"],["4.247","2785","0","6"],["4.248","2002","0","15"],["4.249","1975","0","15"],["4.25","3469","0","28"],["4.251","928","0","9"],["4.252","316","0","6"],["4.253","3042","0","16"],["4.254","793","0","8"],["4.255","3592","0","12"],["4.256","4737","0","10"],["4.257","470","0","5"],["4.258","1411","0","13"],["4.259","7380","0","11"],["4.26","144421","0","16"],["4.261","108","0","5"],["4.262","168","0","3"],["4.263","1090","0","5"],["4.264","3169","0","7"],["4.265","278","0","4"],["4.266","479","0","6"],["4.267","1097","0","9"],["4.268","295","0","4"],["4.269","56","0","4"],["4.27","392","0","8"],["4.272","21","0","3"],["4.273","1","0","1"],["4.274","3","0","3"],["4.275","172","0","5"],["4.276","3053","0","5"],["4.277","683","0","1"],["4.278","452","0","5"],["4.279","24","0","3"],["4.28","371","0","7"],["4.281","1","0","1"],["4.282","129","0","2"],["4.283","1","0","1"],["4.284","6155","0","2"],["4.285","216","0","3"],["4.286","7519","0","7"],["4.288","687","0","7"],["4.289","26","0","6"],["4.29","189","0","7"],["4.291","3627","0","2"],["4.292","2","0","2"],["4.293","1786","0","1"],["4.294","87","0","3"],["4.295","42","0","1"],["4.296","2835","0","2"],["4.297","1310","0","9"],["4.298","304","0","5"],["4.299","580","0","4"],["4.3","1558","0","23"],["4.301","13","0","1"],["4.302","26","0","2"],["4.303","250","0","1"],["4.304","993","0","6"],["4.305","140","0","3"],["4.306","46","0","4"],["4.307","5001","0","2"],["4.308","219","0","3"],["4.31","720","0","11"],["4.311","4","0","1"],["4.312","1","0","1"],["4.313","1","0","1"],["4.314","863","0","2"],["4.316","44","0","3"],["4.318","125","0","5"],["4.319","379","0","4"],["4.32","1441","0","12"],["4.321","25","0","1"],["4.322","399","0","2"],["4.323","244","0","2"],["4.324","1","0","1"],["4.325","10","0","1"],["4.326","50","0","3"],["4.327","3250","0","1"],["4.328","104","0","3"],["4.329","20","0","1"],["4.33","320","0","10"],["4.332","1","0","1"],["4.333","43","0","4"],["4.334","7","0","2"],["4.335","2","0","1"],["4.336","1042","0","3"],["4.337","637","0","2"],["4.338","600","0","3"],["4.34","327","0","13"],["4.341","43","0","1"],["4.342","22","0","2"],["4.343","938","0","1"],["4.344","1","0","1"],["4.346","435","0","2"],["4.348","499","0","4"],["4.349","72","0","2"],["4.35","4346","0","44"],["4.351","100","0","1"],["4.352","589","0","3"],["4.353","318","0","4"],["4.354","1","0","1"],["4.355","662","0","7"],["4.356","6702","0","5"],["4.358","20","0","4"],["4.359","5","0","1"],["4.36","37","0","9"],["4.362","16","0","3"],["4.364","96","0","3"],["4.365","140","0","4"],["4.366","284","0","3"],["4.367","1","0","1"],["4.368","489","0","7"],["4.369","1153","0","16"],["4.37","2687","0","11"],["4.371","2","0","1"],["4.372","1","0","1"],["4.374","427","0","5"],["4.375","207","0","3"],["4.376","1","0","1"],["4.377","50","0","1"],["4.378","48","0","3"],["4.38","696","0","12"],["4.381","4","0","1"],["4.382","456","0","3"],["4.384","222","0","3"],["4.385","22","0","2"],["4.386","1316","0","2"],["4.387","56","0","2"],["4.388","217","0","4"],["4.389","56","0","3"],["4.39","1873","0","8"],["4.391","439","0","1"],["4.392","1","0","1"],["4.394","1","0","1"],["4.395","1019","0","2"],["4.396","1","0","1"],["4.398","78","0","6"],["4.399","1374","0","11"],["4.4","4945","0","41"],["4.401","13","0","1"],["4.402","89","0","2"],["4.403","115","0","2"],["4.404","226","0","2"],["4.406","1","0","1"],["4.408","133","0","2"],["4.409","44","0","1"],["4.41","1547","0","63"],["4.411","5","0","1"],["4.412","398","0","2"],["4.413","318","0","5"],["4.414","1","0","1"],["4.415","547","0","5"],["4.416","676","0","3"],["4.417","70","0","1"],["4.418","45","0","2"],["4.419","132","0","1"],["4.42","2159","0","8"],["4.422","492","0","3"],["4.423","88","0","1"],["4.424","1","0","1"],["4.425","154","0","1"],["4.426","242","0","3"],["4.428","9","0","3"],["4.429","138","0","2"],["4.43","5249","0","12"],["4.432","32","0","3"],["4.433","44","0","1"],["4.434","6391","0","4"],["4.436","1","0","1"],["4.438","669","0","3"],["4.44","9","0","4"],["4.441","15","0","1"],["4.442","1525","0","10"],["4.444","56","0","5"],["4.446","1","0","1"],["4.448","445","0","2"],["4.449","6542","0","3"],["4.45","10535","0","23"],["4.451","143","0","2"],["4.452","301","0","2"],["4.453","13","0","1"],["4.454","1","0","1"],["4.455","44","0","1"],["4.456","236","0","4"],["4.457","8031","0","3"],["4.458","1","0","1"],["4.459","200","0","1"],["4.46","90","0","8"],["4.462","827","0","3"],["4.464","21","0","2"],["4.465","365","0","4"]],"bids":[["4.235","2533","0","9"],["4.234","659","0","5"],["4.233","2002","0","6"],["4.232","1354","0","22"],["4.231","1165","0","20"],["4.23","416","0","70"],["4.229","1614","0","37"],["4.228","1219","0","34"],["4.227","633","0","31"],["4.226","2109","0","36"],["4.225","623","0","75"],["4.224","1262","0","35"],["4.223","2499","0","33"],["4.222","726","0","28"],["4.221","3395","0","31"],["4.22","3898","0","24"],["4.219","1133","0","24"],["4.218","727","0","14"],["4.217","681","0","8"],["4.216","451","0","6"],["4.215","920","0","8"],["4.214","2385","0","1"],["4.213","330","0","4"],["4.212","1","0","1"],["4.211","63","0","2"],["4.21","926","0","3"],["4.209","153","0","2"],["4.208","349","0","2"],["4.207","631","0","1"],["4.206","3099","0","2"],["4.204","201","0","2"],["4.203","200","0","2"],["4.202","3","0","3"],["4.201","50","0","1"],["4.2","56116","0","7"],["4.198","1","0","1"],["4.196","42","0","2"],["4.195","160","0","1"],["4.194","1","0","1"],["4.192","1","0","1"],["4.19","681","0","4"],["4.188","2","0","2"],["4.187","10","0","1"],["4.186","43","0","3"],["4.185","20","0","1"],["4.184","4369","0","2"],["4.183","335","0","3"],["4.182","1","0","1"],["4.181","311","0","3"],["4.18","844","0","9"],["4.179","175","0","2"],["4.178","3","0","2"],["4.177","2760","0","1"],["4.176","43","0","3"],["4.175","813","0","5"],["4.174","252","0","3"],["4.173","2207","0","4"],["4.172","6196","0","3"],["4.171","15589","0","7"],["4.17","1308","0","9"],["4.169","14","0","3"],["4.168","126","0","3"],["4.167","384","0","3"],["4.166","92","0","3"],["4.165","514","0","9"],["4.164","3","0","3"],["4.163","1","0","1"],["4.162","5","0","4"],["4.161","121","0","3"],["4.16","861","0","15"],["4.158","54","0","5"],["4.157","159","0","3"],["4.156","542","0","3"],["4.155","176","0","6"],["4.154","202","0","3"],["4.152","1144","0","8"],["4.151","1372","0","14"],["4.15","2810","0","27"],["4.148","1","0","1"],["4.146","43","0","3"],["4.144","2","0","2"],["4.143","1","0","1"],["4.142","3","0","2"],["4.141","1154","0","4"],["4.14","666","0","9"],["4.139","917","0","1"],["4.138","201","0","2"],["4.136","50","0","3"],["4.134","4","0","2"],["4.133","1849","0","4"],["4.132","120","0","3"],["4.131","196","0","2"],["4.13","1733","0","11"],["4.129","406","0","2"],["4.128","165","0","4"],["4.127","2","0","1"],["4.126","1203","0","3"],["4.125","628","0","5"],["4.124","6","0","3"],["4.123","28","0","2"],["4.122","209","0","3"],["4.121","5","0","1"],["4.12","1932","0","10"],["4.119","267","0","2"],["4.118","7","0","2"],["4.117","300","0","1"],["4.116","280","0","7"],["4.115","125","0","1"],["4.114","2853","0","5"],["4.112","212","0","2"],["4.111","50","0","3"],["4.11","154","0","7"],["4.109","2063","0","4"],["4.108","82","0","4"],["4.107","7240","0","14"],["4.106","301","0","2"],["4.105","9","0","2"],["4.104","323","0","4"],["4.103","191","0","1"],["4.102","1","0","1"],["4.101","702","0","2"],["4.1","4689","0","39"],["4.098","20001","0","2"],["4.097","1800","0","2"],["4.096","241","0","3"],["4.094","1414","0","5"],["4.093","41","0","2"],["4.092","3","0","2"],["4.091","10","0","1"],["4.09","4065","0","17"],["4.088","1409","0","3"],["4.086","512","0","3"],["4.085","109","0","2"],["4.084","1","0","1"],["4.082","13","0","2"],["4.081","422","0","2"],["4.08","723","0","12"],["4.079","20","0","1"],["4.078","1878","0","23"],["4.077","1092","0","3"],["4.076","271","0","2"],["4.075","2852","0","2"],["4.074","1","0","1"],["4.073","407","0","1"],["4.072","1","0","1"],["4.071","81","0","1"],["4.07","120","0","6"],["4.068","90","0","2"],["4.066","1","0","1"],["4.065","243","0","2"],["4.064","309","0","3"],["4.062","1","0","1"],["4.061","458","0","2"],["4.06","1669","0","8"],["4.058","721","0","4"],["4.056","252","0","3"],["4.055","771","0","5"],["4.054","1","0","1"],["4.052","292","0","4"],["4.05","1698","0","19"],["4.049","424","0","3"],["4.048","1","0","1"],["4.046","1","0","1"],["4.045","110","0","1"],["4.044","1","0","1"],["4.043","32","0","2"],["4.042","1","0","1"],["4.041","20","0","1"],["4.04","4116","0","5"],["4.038","501","0","2"],["4.037","121","0","1"],["4.036","41","0","2"],["4.034","243","0","3"],["4.033","443","0","1"],["4.032","1","0","1"],["4.03","91","0","8"],["4.028","216","0","2"],["4.026","1","0","1"],["4.025","104","0","3"],["4.024","258","0","2"],["4.022","81","0","2"],["4.021","540","0","2"],["4.02","2579","0","19"],["4.018","1","0","1"],["4.017","622","0","3"],["4.016","41","0","2"],["4.014","301","0","3"],["4.013","50","0","1"],["4.012","1","0","1"],["4.011","1212","0","3"],["4.01","73","0","10"],["4.008","9","0","2"],["4.007","40","0","2"],["4.006","41","0","2"],["4.005","4786","0","12"],["4.004","1","0","1"],["4.003","300","0","1"],["4.002","1","0","1"],["4.001","62","0","2"],["4","3985","0","55"]],"timestamp":"2019-07-20T15:03:39.426Z","checksum":1530207004}]}';
//$update = '{"table":"futures/depth","action":"update","data":[{"instrument_id":"EOS-USD-190927","asks":[["4.236","122","0","15"],["4.238","4843","0","6"],["4.239","684","0","5"],["4.24","703","0","11"],["4.241","829","0","9"],["4.242","9019","0","9"],["4.244","708","0","8"],["4.245","767","0","6"],["4.246","1647","0","15"],["4.248","1802","0","14"],["4.25","3869","0","29"],["4.251","1732","0","12"],["4.264","3079","0","6"]],"bids":[["4.226","2234","0","37"],["4.225","510","0","74"],["4.222","826","0","29"],["4.221","3495","0","32"],["4.218","827","0","15"],["4.216","551","0","7"]],"timestamp":"2019-07-20T15:03:39.551Z","checksum":-1505000986}]}';

$checksum = new ChecksumTest();

$partial = $checksum->depthMerge($partial,$update);

print_r("全量数据");
print_r("\n");
print_r($partial);
print_r("\n");

// java
//$partial = '{"table":"futures/depth","action":"partial","data":[{"instrument_id":"BSV-USD-190816","asks":[["123.97","40","0"],["124.0","24","0"],["124.03","96","0"],["124.06","96","0"],["124.12","2","0"],["124.13","3","0"],["124.14","1645","0"],["124.19","250","0"],["124.21","10","0"],["124.22","10","0"],["124.23","240","0"],["124.25","10","0"],["124.31","66","0"],["124.4","233","0"],["124.45","360","0"],["124.5","757","0"],["124.59","865","0"],["124.75","960","0"],["124.8","2000","0"],["125.06","1522","0"],["125.09","1080","0"],["125.16","1230","0"],["125.3","121","0"],["125.33","30","0"],["125.44","144","0"],["125.7","5839","0"],["126.21","3528","0"],["127.15","2469","0"],["128.08","1189","0"],["131.0","515","0"],["138.3","64","0"],["138.31","128","0"],["138.33","128","0"],["141.37","128","0"],["142.37","64","0"],["142.9","64","0"],["144.43","106","0"],["144.46","20","0"],["144.86","185","0"],["145.29","187","0"],["145.72","239","0"],["146.15","101","0"],["146.58","228","0"],["147.01","299","0"],["147.45","297","0"],["147.89","283","0"],["148.33","223","0"],["148.77","278","0"],["149.21","129","0"],["149.65","269","0"],["150.09","128","0"],["150.16","20","0"],["150.54","124","0"],["150.99","134","0"],["151.44","213","0"],["151.89","195","0"],["152.34","116","0"],["152.79","224","0"],["153.24","290","0"],["153.69","202","0"],["154.15","243","0"],["154.61","286","0"],["155.07","126","0"],["155.53","185","0"],["155.99","167","0"],["156.45","204","0"],["156.46","64","0"],["156.91","191","0"],["157.38","244","0"],["157.85","249","0"],["158.32","234","0"],["158.79","236","0"],["159.26","163","0"],["159.73","273","0"],["160.0","1","0"],["160.2","106","0"],["160.21","264","0"],["160.69","187","0"],["161.17","125","0"],["161.66","253","0"],["165.0","1","0"],["169.0","1","0"]],"bids":[["123.66","44","0"],["123.62","6","0"],["123.53","364","0"],["123.49","2","0"],["123.44","24","0"],["123.43","120","0"],["123.42","24","0"],["123.39","231","0"],["123.37","96","0"],["123.35","96","0"],["123.23","16","0"],["123.21","240","0"],["123.19","2046","0"],["123.14","90","0"],["123.04","1230","0"],["122.97","360","0"],["122.96","196","0"],["122.9","360","0"],["122.89","2000","0"],["122.8","1385","0"],["122.6","480","0"],["122.59","480","0"],["122.58","5839","0"],["122.34","30","0"],["122.06","3529","0"],["121.76","2470","0"],["121.64","64","0"],["121.11","64","0"],["120.83","1190","0"],["120.55","159","0"],["118.36","142","0"],["114.0","10","0"],["104.76","202","0"],["104.45","213","0"],["104.14","160","0"],["103.82","138","0"],["103.5","282","0"],["103.18","159","0"],["102.87","106","0"],["102.56","189","0"],["102.25","161","0"],["101.94","197","0"],["101.63","117","0"],["101.32","145","0"],["101.01","288","0"],["100.7","149","0"],["100.39","193","0"],["100.08","271","0"],["99.77","273","0"],["99.47","233","0"],["99.17","147","0"],["98.87","122","0"],["98.57","149","0"],["98.27","205","0"],["97.97","102","0"],["97.67","269","0"],["97.37","237","0"],["97.07","235","0"],["96.77","194","0"],["96.47","265","0"],["96.18","102","0"],["95.89","105","0"],["95.6","166","0"],["95.31","195","0"],["95.02","295","0"],["94.73","135","0"],["94.44","291","0"],["94.15","276","0"],["93.86","237","0"],["93.57","104","0"],["93.28","258","0"],["93.0","235","0"]],"timestamp":"2019-08-15T06:45:25.258Z","checksum":174965541}]}';
// php
//$partial = '{"table":"futures/depth","action":"partial","data":[{"instrument_id":"BCH-USD-191227","asks":[["297.79","180","0","2"],["297.83","100","0","1"],["297.84","1134","0","4"],["297.87","1","0","1"],["297.88","190","0","2"],["297.91","52","0","2"],["297.92","88","0","2"],["297.96","341","0","3"],["297.97","101","0","6"],["297.98","136","0","6"],["297.99","285","0","4"],["298.0","101","0","2"],["298.01","60","0","1"],["298.02","62","0","1"],["298.03","27","0","2"],["298.04","24","0","1"],["298.05","149","0","3"],["298.06","161","0","4"],["298.07","3","0","3"],["298.08","256","0","1"],["298.09","35","0","2"],["298.1","446","0","2"],["298.11","150","0","2"],["298.12","200","0","1"],["298.13","96","0","2"],["298.16","318","0","2"],["298.18","2","0","2"],["298.19","2025","0","3"],["298.2","118","0","2"],["298.21","150","0","1"],["298.23","160","0","1"],["298.25","100","0","1"],["298.26","218","0","2"],["298.28","440","0","1"],["298.32","13","0","1"],["298.33","14","0","2"],["298.34","14","0","2"],["298.35","160","0","1"],["298.36","824","0","4"],["298.37","166","0","2"],["298.38","100","0","1"],["298.4","600","0","1"],["298.42","280","0","1"],["298.44","550","0","3"],["298.45","713","0","4"],["298.46","170","0","1"],["298.47","505","0","2"],["298.48","643","0","2"],["298.49","640","0","1"],["298.5","26","0","2"],["298.51","220","0","1"],["298.52","6879","0","2"],["298.53","640","0","1"],["298.55","60","0","1"],["298.56","100","0","1"],["298.57","225","0","1"],["298.6","484","0","3"],["298.61","231","0","2"],["298.62","280","0","1"],["298.63","525","0","3"],["298.66","3030","0","1"],["298.68","26","0","2"],["298.7","87","0","1"],["298.71","634","0","2"],["298.72","664","0","4"],["298.74","225","0","1"],["298.76","872","0","4"],["298.77","352","0","1"],["298.78","225","0","1"],["298.79","102","0","1"],["298.83","1055","0","2"],["298.85","6","0","1"],["298.87","13","0","1"],["298.88","132","0","1"],["298.89","1025","0","5"],["298.9","127","0","1"],["298.93","3","0","1"],["298.96","127","0","1"],["299.0","10","0","1"],["299.02","960","0","1"],["299.06","960","0","1"],["299.08","300","0","2"],["299.1","960","0","1"],["299.15","3042","0","2"],["299.19","2999","0","1"],["299.2","3000","0","1"],["299.23","9038","0","3"],["299.27","2903","0","1"],["299.3","17","0","1"],["299.36","3694","0","1"],["299.38","3","0","1"],["299.42","88","0","1"],["299.53","300","0","2"],["299.55","547","0","1"],["299.6","29","0","1"],["299.67","1280","0","1"],["299.7","2480","0","2"],["299.82","3","0","1"],["299.85","1280","0","1"],["299.86","25","0","1"],["299.9","14","0","1"],["299.98","6355","0","2"],["300.0","3376","0","9"],["300.01","66","0","1"],["300.12","750","0","1"],["300.22","3639","0","1"],["300.26","35","0","1"],["300.27","3","0","1"],["300.47","6001","0","1"],["300.5","1616","0","1"],["300.71","78","0","1"],["300.72","3","0","1"],["300.96","2440","0","1"],["301.0","1344","0","3"],["301.16","3","0","1"],["301.37","2","0","1"],["301.51","120","0","1"],["301.53","603","0","1"],["301.54","20","0","1"],["301.57","1999","0","1"],["301.61","4","0","1"],["301.7","250","0","1"],["302.0","147","0","3"],["302.06","4","0","1"],["302.36","33","0","1"],["302.45","1190","0","1"],["302.51","4","0","1"],["302.52","30","0","1"],["302.65","4698","0","1"],["302.66","3631","0","1"],["302.72","3999","0","1"],["302.88","614","0","2"],["302.95","4","0","1"],["303.0","2010","0","2"],["303.26","20","0","1"],["303.33","30","0","2"],["303.36","10","0","1"],["303.4","4","0","1"],["303.5","6242","0","2"],["303.66","30","0","1"],["303.8","1494","0","1"],["303.85","4","0","1"],["304.0","3394","0","9"],["304.15","121","0","1"],["304.29","4","0","1"],["304.3","91","0","1"],["304.34","91","0","1"],["304.35","334","0","2"],["304.39","35","0","1"],["304.43","608","0","1"],["304.6","251","0","1"],["304.63","30","0","1"],["304.74","4","0","1"],["304.78","13","0","1"],["304.8","2072","0","2"],["304.92","30","0","1"],["305.0","1953","0","9"],["305.19","4","0","1"],["305.2","30","0","1"],["305.48","2160","0","2"],["305.5","2430","0","4"],["305.63","5","0","1"],["305.76","30","0","1"],["305.9","30","0","1"],["306.0","1625","0","5"],["306.04","30","0","1"],["306.08","5","0","1"],["306.13","30","0","1"],["306.16","73","0","1"],["306.18","30","0","1"],["306.32","30","0","1"],["306.47","30","0","1"],["306.51","7049","0","1"],["306.53","5","0","1"],["306.61","30","0","1"],["306.62","527","0","1"],["306.75","30","0","1"],["306.89","30","0","1"],["306.98","5","0","1"],["307.0","1101","0","7"],["307.03","30","0","1"],["307.17","30","0","1"],["307.31","30","0","1"],["307.42","5","0","1"],["307.45","830","0","2"],["307.59","4030","0","2"],["307.6","25","0","1"],["307.73","6029","0","2"],["307.76","8","0","1"],["307.87","135","0","3"],["308.0","1957","0","5"],["308.02","30","0","1"],["308.16","30","0","1"],["308.3","30","0","1"],["308.32","6","0","1"],["308.44","30","0","1"],["308.5","123","0","1"],["308.58","30","0","1"],["308.72","49","0","1"],["308.76","6","0","1"]],"bids":[["297.77","375","0","2"],["297.76","13","0","4"],["297.72","400","0","1"],["297.71","76","0","2"],["297.7","10","0","1"],["297.69","36","0","1"],["297.67","26","0","2"],["297.65","298","0","2"],["297.63","22","0","4"],["297.62","40","0","3"],["297.61","35","0","1"],["297.6","12","0","1"],["297.58","542","0","6"],["297.56","58","0","1"],["297.55","64","0","1"],["297.54","127","0","5"],["297.53","274","0","5"],["297.52","37","0","2"],["297.51","128","0","4"],["297.5","133","0","2"],["297.49","28","0","5"],["297.48","53","0","19"],["297.47","115","0","2"],["297.46","90","0","4"],["297.45","150","0","2"],["297.44","60","0","1"],["297.43","61","0","2"],["297.42","2","0","2"],["297.41","514","0","4"],["297.39","75","0","1"],["297.38","70","0","2"],["297.37","346","0","2"],["297.36","26","0","2"],["297.35","440","0","1"],["297.33","140","0","2"],["297.32","35","0","1"],["297.31","100","0","1"],["297.29","300","0","1"],["297.28","4","0","4"],["297.27","166","0","3"],["297.26","600","0","1"],["297.25","90","0","1"],["297.23","575","0","3"],["297.2","92","0","1"],["297.19","800","0","2"],["297.18","27","0","3"],["297.15","100","0","1"],["297.14","30","0","1"],["297.13","1","0","1"],["297.11","1999","0","1"],["297.07","2","0","2"],["297.06","1","0","1"],["297.03","1339","0","3"],["297.01","1","0","1"],["297.0","648","0","2"],["296.99","713","0","3"],["296.98","43","0","3"],["296.97","225","0","1"],["296.9","1196","0","4"],["296.89","520","0","3"],["296.88","1","0","1"],["296.85","170","0","1"],["296.84","205","0","1"],["296.82","102","0","1"],["296.77","13","0","1"],["296.76","6","0","1"],["296.75","280","0","1"],["296.73","232","0","3"],["296.71","898","0","3"],["296.69","8","0","3"],["296.66","10","0","1"],["296.65","102","0","1"],["296.63","225","0","1"],["296.59","1","0","1"],["296.57","1","0","1"],["296.53","963","0","2"],["296.52","960","0","1"],["296.45","6","0","1"],["296.44","1260","0","3"],["296.34","352","0","1"],["296.32","148","0","1"],["296.3","592","0","1"],["296.26","100","0","1"],["296.25","1","0","1"],["296.21","6","0","1"],["296.18","46","0","1"],["296.09","3","0","1"],["296.07","2076","0","1"],["296.05","3000","0","1"],["296.0","99","0","3"],["295.99","300","0","2"],["295.98","3000","0","1"],["295.97","1200","0","1"],["295.94","3000","0","1"],["295.9","2109","0","3"],["295.86","1280","0","1"],["295.82","1280","0","1"],["295.81","2999","0","1"],["295.78","1280","0","1"],["295.64","3","0","1"],["295.6","2000","0","1"],["295.5","6078","0","2"],["295.43","830","0","1"],["295.36","53","0","1"],["295.2","400","0","2"],["295.19","3","0","1"],["295.18","885","0","1"],["295.11","400","0","2"],["295.1","59","0","1"],["295.0","4634","0","19"],["294.99","6001","0","1"],["294.92","29","0","1"],["294.88","10","0","1"],["294.76","86","0","1"],["294.75","3","0","1"],["294.68","1200","0","1"],["294.63","29","0","1"],["294.62","8","0","1"],["294.45","4682","0","1"],["294.44","6043","0","2"],["294.35","294","0","2"],["294.3","61","0","2"],["294.27","300","0","1"],["294.21","735","0","1"],["294.18","147","0","1"],["294.07","29","0","1"],["294.01","1470","0","1"],["294.0","676","0","7"],["293.86","4","0","1"],["293.79","29","0","1"],["293.7","3640","0","1"],["293.66","1468","0","1"],["293.62","176","0","1"],["293.51","29","0","1"],["293.5","833","0","3"],["293.46","14","0","1"],["293.41","4","0","1"],["293.29","5","0","1"],["293.25","2441","0","1"],["293.2","8","0","1"],["293.11","25","0","1"],["293.1","1465","0","2"],["293.08","439","0","1"],["293.04","550","0","1"],["293.01","219","0","1"],["293.0","2164","0","11"],["292.96","6","0","2"],["292.89","20","0","1"],["292.88","2","0","1"],["292.8","268","0","1"],["292.74","1463","0","1"],["292.63","20","0","1"],["292.6","20","0","1"],["292.52","4","0","1"],["292.42","34","0","1"],["292.4","1462","0","1"],["292.27","200","0","1"],["292.07","4","0","1"],["292.01","3999","0","1"],["292.0","584","0","9"],["291.77","8","0","1"],["291.76","1191","0","1"],["291.67","145","0","1"],["291.63","54","0","2"],["291.19","1800","0","1"],["291.18","4","0","1"],["291.0","216","0","8"],["290.99","123","0","1"],["290.88","872","0","1"],["290.8","2","0","1"],["290.79","200","0","1"],["290.73","4","0","1"],["290.69","29","0","1"],["290.66","30","0","1"],["290.62","145","0","1"],["290.6","50","0","1"],["290.56","4","0","1"],["290.5","116","0","1"],["290.35","8","0","1"],["290.29","4","0","1"],["290.1","580","0","1"],["290.02","50","0","1"],["290.0","11908","0","29"],["289.95","2","0","1"],["289.84","5","0","1"],["289.81","434","0","1"],["289.7","1065","0","2"],["289.56","1163","0","2"],["289.4","14","0","1"],["289.39","5","0","1"],["289.2","1446","0","1"],["289.04","5","0","1"],["289.01","3000","0","1"],["289.0","8036","0","7"],["288.95","5","0","1"],["288.94","3000","0","1"],["288.93","14","0","1"],["288.9","3000","0","1"],["288.88","1888","0","3"],["288.86","10","0","1"]],"timestamp":"2019-09-24T10:54:00.856Z","checksum":297727568}]}';
//print_r($partial."\n");
$state = $checksum->checkSum($partial);

//print_r($state);
//$test = "119.95:9.2794:119.96:0.0023:119.94:12.0194:120.01:0.1667:119.92:7.5142:120.02:0.0146:119.91:0.9664:120.09:6.25:119.9:14:120.1:3:119.89:0.1666:120.11:6.4819:119.87:0.012:120.15:5.2697:119.86:6.252:120.16:13.4878:119.84:15.4802:120.19:8.2437:119.83:13.3988:120.21:58.3489:119.82:24.8308:120.22:8.3793:119.81:4.3429:120.23:13.0337:119.8:6.255:120.26:66.699:119.76:33.3316:120.28:13.84:119.75:13.5807:120.32:40:119.74:3:120.34:2.46:119.64:66.6753:120.35:5.055:119.61:34:120.36:4.36:119.59:4.39:120.37:12.9985:119.58:40:120.45:33.999:119.57:17.03:120.47:0.3331:119.54:8.6851:120.49:5.12:119.52:0.243:120.58:0.2:119.51:20:120.64:35.54:119.49:13.0277:120.77:19.534";
//$test = '10198:0.3734423:10198.1:12.21877497:10197.1:1.094:10198.2:0.019:10196.8:0.00196099:10198.5:0.029:10196.7:0.93:10198.6:0.017:10195.9:0.088:10198.9:0.2:10195.8:0.96217826:10199:2:10195.3:0.705:10199.1:0.017:10195.2:0.1:10199.4:0.0019611:10195.1:0.324:10199.5:0.063:10195:1:10199.6:0.4:10194.7:0.0094041:10199.7:0.001:10194.6:0.2:10199.8:1.682:10194.5:1.20161963:10200:0.5:10194:0.04:10200.1:0.50658763:10193.9:0.0019616:10200.3:3.99493844:10193.4:0.05134215:10200.6:0.017:10193.2:0.05:10200.8:1.31780321:10193:0.04904649:10200.9:0.197:10192.9:0.2:10201:0.2:10192.8:0.26903274:10201.3:0.05:10192.5:0.2601525:10201.6:0.45637232:10192.2:1.27452464:10201.7:0.15240005:10192:0.04:10201.8:0.606:10191.6:0.05:10201.9:0.31157305:10191.4:0.04:10202:0.001';
//$test = '10198:0.3734423:10198.1:12.21877497:10197.1:1.094:10198.2:0.019:10196.8:0.00196099:10198.5:0.029:10196.7:0.93:10198.6:0.017:10195.9:0.088:10198.9:0.2:10195.8:0.96217826:10199:2:10195.3:0.705:10199.1:0.017:10195.2:0.1:10199.4:0.0019611:10195.1:0.324:10199.6:0.4:10195:1:10199.7:0.001:10194.7:0.0094041:10199.8:1.682:10194.6:0.2:10199.9:0.003637:10194.5:1.20161963:10200:0.5:10194:0.04:10200.1:0.00658763:10193.9:0.0019616:10200.3:3.99493844:10193.2:0.05:10200.6:0.017:10193:0.04904649:10200.8:1.31780321:10192.9:0.2:10200.9:0.197:10192.8:0.32037489:10201:0.2:10192.5:0.2601525:10201.3:0.05:10192.2:1.27452464:10201.4:0.37833406:10192:0.04:10201.6:0.45637232:10191.6:0.05:10201.7:0.15240005:10191.4:0.04:10201.8:0.606:10191.3:0.34806016:10201.9:0.31157305';
//$test = '10198:0.3734423:10198.1:12.21877497:10197.1:1.094:10198.2:0.019:10196.8:0.00196099:10198.5:0.029:10196.7:0.93:10198.6:0.017:10195.9:0.088:10198.9:0.2:10195.8:0.96217826:10199:2:10195.3:0.705:10199.1:0.017:10195.2:0.1:10199.4:0.0019611:10195.1:0.324:10199.5:0.063:10195:1:10199.6:0.4:10194.7:0.0094041:10199.7:0.001:10194.6:0.2:10199.8:1.682:10194.5:1.20161963:10200:0.5:10194:0.04:10200.1:0.50658763:10193.9:0.0019616:10200.3:3.99493844:10193.4:0.05134215:10200.6:0.017:10193.2:0.05:10200.8:1.31780321:10193:0.04904649:10200.9:0.197:10192.9:0.2:10201:0.2:10192.8:0.26903274:10201.3:0.05:10192.5:0.2601525:10201.6:0.45637232:10192.2:1.27452464:10201.7:0.15240005:10192:0.04:10201.8:0.606:10191.6:0.05:10201.9:0.31157305:10191.4:0.04:10202:0.001';
//$state = $checksum->getCrc32($partial);

if ($state){
    echo "校验成功\n";
//    print_r($partial);
}else{
    echo "校验失败\n";
}

class ChecksumTest{
    /**
     * 校验和
     * @param $partial
     * @return bool
     */
    function checksum($partial){

        $partial = json_decode($partial, true);

        $asks = array_values($partial["data"][0]["asks"]);

        $bids = array_values($partial["data"][0]["bids"]);

        $strs="";
        for ($i=0; $i<25; $i++){
            if (@$bids[$i]){
                $strs.=$bids[$i][0];
                $strs.=":";
                $strs.=$bids[$i][1];
                $strs.=":";
            }

            if (@$asks[$i]){
                $strs.=$asks[$i][0];
                $strs.=":";
                $strs.=$asks[$i][1];
                $strs.=":";
            }
        }

        $strs = substr($strs,0,strlen($strs)-1);

        print_r($strs . "\n");

        $strs = crc32($strs);

        // 计算前25档的checksum
        $strs = $this->get_signed_int($strs);

        switch (true)
        {
            case ($partial["data"][0]["checksum"]==$strs);
                return true;
                break;
            default:
                return false;
                break;
        }
//        print_r("\nchecksum:".$strs);
    }

    /**
     * 深度合并
     * @param $partial
     * @param $update
     * @return false|string
     */
    function depthMerge($partial, $update){

        $partial = json_decode($partial,true);
        $update = json_decode($update,true);

        $ndata = $partial;

        $partialAsks = $partial["data"][0]["asks"];
        $partialBids = $partial["data"][0]["bids"];
        $updateAsks = $update["data"][0]["asks"];
        $updateBids = $update["data"][0]["bids"];

        if (!empty($updateAsks)){

            for ($i=0; $i<count($partialAsks); $i++){
                for($j=0; $j<count($updateAsks); $j++){
                    switch (true){
                        // 如果价格相同
                        case ($updateAsks[$j][0]==$partialAsks[$i][0]);
                            switch (true){
                                // 数量为0删除此深度，数量有变化则替换此数据
                                case ($updateAsks[$j][1] == 0);
                                    unset($ndata["data"][0]["asks"][$i]);
                                    break;
                                // 同价格，不同数量，替换
                                case ($updateAsks[$j][1] != $partialAsks[$i][1]);
                                    $ndata["data"][0]["asks"][$i][1] = $updateAsks[$j][1];
                                    break;
                            }
                            break;
                        // 如何价格不同
                        case (!$this->deep_in_array($updateAsks[$j][0],$ndata["data"][0]["asks"]) and $updateAsks[$j][1] != 0);
                            array_push($ndata["data"][0]["asks"], $updateAsks[$j]);
                            break;
                    }
                }
            }
        }

        if (!empty($updateBids)){

            for ($i=0; $i<count($partialBids); $i++){
                for($j=0; $j<count($updateBids); $j++){
                    switch (true){
                        // 如果价格相同
                        case ($updateBids[$j][0] == $partialBids[$i][0]);
                            switch (true){
                                case ($updateBids[$j][1] ==0);
                                    unset($ndata["data"][0]["bids"][$i]);
                                    break;
                                case ($updateBids[$j][1] != $partialBids[$i][1]);
                                    $ndata["data"][0]["bids"][$i][1] = $updateBids[$j][1];
                                    break;
                            }
                            break;

                        // 如果 价格不同
                        case (!$this->deep_in_array($updateBids[$j][0], $ndata["data"][0]["bids"]) and $updateBids[$j][1] != 0);
                            array_push($ndata["data"][0]["bids"], $updateBids[$j]);
                            break;
                    }
                }
            }
        }

        // asks 从小到大排序
        $askPrices = array_column($ndata["data"][0]["asks"],0);
        array_multisort($askPrices,SORT_ASC,$ndata["data"][0]["asks"]);

        // bids 从大到小排序
        $bidPrices = array_column($ndata["data"][0]["bids"],0);
        array_multisort($bidPrices,SORT_DESC,$ndata["data"][0]["bids"]);

        // 换 checksum
        $ndata["data"][0]["checksum"] = $update["data"][0]["checksum"];

//        print_r(json_encode($ndata));
        return json_encode($ndata);
    }

    /**
     * 获取32位校验码
     * @param $in
     * @return float|int
     */
    protected function get_signed_int($in) {
        $int_max = pow(2, 31)-1;
        if ($in > $int_max){
            $out = $in - $int_max * 2 - 2;
        }
        else {
            $out = $in;
        }
        return $out;
    }

    /**
     * // 数组的深度搜索
     * @param $value
     * @param $array
     * @return bool
     */
    protected function deep_in_array($value, $array) {
        foreach($array as $item) {
            if (!is_array($item)) {
                if ($item == $value) {
                    return true;
                } else {
                    continue;
                }
            }

            if (in_array($value, $item)) {
                return true;
            } else if ($this->deep_in_array($value, $item)) {
                return true;
            }
        }

        return false;
    }

    public function getCrc32($strs){

        $strs = crc32($strs);

        // 计算前25档的checksum
        $strs = $this->get_signed_int($strs);

        print_r($strs);
        print_r("\n");
    }
}
